// no 4 and 14
#include "Fraction.h"
#include <iostream>
#include <stdio.h>
#include <math.h>
Fraction::Fraction()
{
	this -> numerator = 1;
	this -> denominator = 1;
}
Fraction::Fraction(int n, int d)
{
	this -> numerator = n;
	this -> denominator = d;
}
Fraction::Fraction(const Fraction *f)
{
	this -> numerator = f -> numerator;
	this -> denominator = f -> denominator;
}
Fraction::Fraction(const Fraction &f)
{
	this -> numerator = f.numerator;
	this -> denominator = f.denominator;
}
int Fraction::getNum(void) const
{
	return this -> numerator;
}
int Fraction::getDen(void) const
{
	return this -> denominator;
}
void Fraction::setNum(int num)
{
	this -> numerator = num;
}
void Fraction::setDen(int den)
{
	this -> denominator = den;
}
Fraction Fraction::operator * (const Fraction &f)
{
	int num = this -> numerator * f.numerator;
	int den = this -> denominator * f.denominator;
	return Fraction(num, den);
}
Fraction Fraction::operator * (int nr)
{
	int num = this -> numerator * nr;
	return Fraction(num, this -> denominator);
}
Fraction operator * (int nr, const Fraction &f)
{
	int num = nr * f.numerator;
	return Fraction(num, f.denominator);
}
void Fraction::Print(void) const
{
	printf("%d/%d\n", this -> numerator, this -> denominator);
}
Fraction Fraction::operator / (const Fraction &f)
{
	int num = this -> numerator * f.denominator;
	int den = this -> denominator * f.numerator;
	return Fraction(num, den);
}
Fraction Fraction::operator / (int nr)
{
	int den = this -> denominator * nr;
	return Fraction(this -> numerator, den);
}
Fraction operator / (int nr, const Fraction &f)
{
	int num = nr * f.denominator;
	return Fraction(num, f.numerator);
}
Fraction Fraction::operator ^ (int power)
{
	int num = pow(this -> numerator, power);
	int den = pow(this -> denominator, power);
	return Fraction(num, den);
}
Fraction Fraction::operator + (const Fraction &f)
{
	int num = f.denominator * this -> numerator + this -> denominator * f.numerator;
	int den = this -> denominator * f.denominator;
	return Fraction(num, den);
}
Fraction Fraction::operator + (int nr)
{
	return Fraction(this -> numerator + this -> denominator * nr, this -> denominator);
}
Fraction operator + (int nr, const Fraction &f)
{
	return Fraction(f.denominator * nr + f.numerator, f.denominator);
}
Fraction Fraction::operator - (const Fraction &f)
{
	int num = f.denominator * this -> numerator - this -> denominator * f.numerator;
	int den = this -> denominator * f.denominator;
	return Fraction(num, den);
}
Fraction Fraction::operator - (int nr)
{
	return Fraction(this -> numerator - this -> denominator * nr, this -> denominator);
}
Fraction operator - (int nr, const Fraction &f)
{
	return Fraction(f.denominator * nr - f.numerator, f.denominator);
}
using namespace std;
int main()	
{
	Fraction f1 = Fraction(2, 2);
	Fraction f2 = Fraction(6, 2);
	Fraction p = 8 - f1;
	Fraction p1 = f2 + 8;
	Fraction p2 = f1 + f2;
	p.Print();
	p1.Print();
	p1.Print();
	return 0;
}